import base from "/common/base.js";
import commonbenefit from "/common/commonbenefit.js";
//语言
import Lang from '@/utils/lang.js';
   
 class Wechat {

	constructor() {
		//默认状态
		this.status = false;
	}
	/**
	 *  是否app
	 */
	isAndroid() {
		let u = navigator.userAgent;
		return u.indexOf('Android') > -1 || u.indexOf('Adr') > -1;
	}
	/**
	 * 是否微信
	 */
	isWeixin() {
		return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
	}
	 
//分享路径判断
shareUrl() {
	var nowurl='';//公共连接
	var url=base.getUrl();
	var arr=url.split('/');
	if(arr[1]=='hitgame'){
		nowurl=commonbenefit.automaticurl('benefitindex');
	}
	if(arr[1]=='benefit'){
		nowurl=commonbenefit.automaticurl('benefitindex');
	}
	return nowurl;
}
	//分享名称
	sharetitle() {
		var title='';//公共连接
		var url=base.getUrl();
		var arr=url.split('/');
		if(arr[1]=='hitgame'){
			title=Lang.lang.benefittitle;
		}
		if(arr[1]=='benefit'){
			title=Lang.lang.benefittitle;
		}
		return title;
	}
	//分享图片
	imageUrl() {
		var image='';//公共连接
		var url=base.getUrl();
		var arr=url.split('/');
		if(arr[1]=='hitgame'){
			image='https://www.iiscchina.com/wp-content/uploads/2023/07/xltdt.png';
		}
		if(arr[1]=='benefit'){
			image='https://www.iiscchina.com/wp-content/uploads/2023/07/xltdt.png';
		}
		return image;
	} 
	 
}

export default new Wechat;